package org.ddd.specification.jpa;

import org.ddd.specification.Specification;
import org.ddd.specification.catalog.AbstractSpecification;

public abstract class JpaSpecification<X> extends AbstractSpecification<X> implements JpaPredicateBuilder<X> {
    private Specification<X> specification;

    public JpaSpecification(Specification<X> specification) {
        this.specification = specification;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isSatisfiedBy(X candidate) {
        return specification.isSatisfiedBy(candidate);
    }

    protected Specification<X> getWrappedSpecification() {
        return specification;
    }

}
